package com.jyz.refinery.sample.service.impl;

import org.apache.log4j.Logger;

import com.jyz.refinery.sample.dao.ISampleDAO;
import com.jyz.refinery.sample.domain.Test1;
import com.jyz.refinery.sample.service.ISampleManager;
import com.jyz.support.exceptions.DAOException;

public class SampleManagerImpl implements ISampleManager {
	
	private final static Logger logger = Logger.getLogger(SampleManagerImpl.class.getName());
	
	private ISampleDAO sampleDAO;

	public ISampleDAO getSampleDAO() {
		return sampleDAO;
	}

	public void setSampleDAO(ISampleDAO sampleDAO) {
		this.sampleDAO = sampleDAO;
	}

	public String helloWorld(String who) throws DAOException {
		Test1 t = new Test1();
		t.setName(who);
		t.setAge(2);
		
		String id = (String)sampleDAO.create(t);
		return id;
	}
	

}
